import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    typeArr:[],
    collectGoodsIdList:[],
    cartList: [],
    isNewUser:false,
    goodsPice:0,
    cartListLength:0
  },
  mutations: {
  },
  actions: {
  },
  modules: {
  },
  getters:{
    typeNameArr:(state)=>{
      let arr = []
      state.typeArr.forEach((item,index)=>{
        arr.push({text:item.name,value:index})
      })
      return arr
    },
    collectGoodsIdList:state=>state.collectGoodsIdList
  }
})
